<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main"><i class="glyphicon glyphicon-modal-window"></i>设备管理</a></li>
        <li><a ui-sref="main.dm.DmMaintain.list" class="active" ng-bind="title"> </a></li>
    </ul>
</div>


<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg dataWarn"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>
<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-heading clearfix">
                <div class="w-auto">
                    <form ng-submit="search()" class="form-inline">
                        <div class="form-group">
                            <label for="name">设备名称：</label>
                            <input type="text"class="form-control" style="width: 180px" id="name"
                                   placeholder="" ng-model="param.deviceName">
                        </div>
                        <div class="form-group">
                            <label for="identity">状态：</label>
                            <select class="form-control" style="width: 140px" ng-model="param.status" name="status"
                                    id="status">
                                <option value="" ng-selected="1">全部</option>
                                <option value="1">待派单</option>
                                <option value="2">待处理</option>
                                <option value="3">待确认</option>
                                <option value="4">已完成</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary new-primary" style="margin-left: 10px" ng-show="read">查询</button>
                        </div>
                        <div class="form-group">
                            <button type="button" class="btn btn-primary addNew" ng-click="allMaintain()">批量派单</button>
                        </div>
 						<div class="form-group">
                            <a ui-sref="main.dm.DmMaintain.create"  class="btn btn-primary addNew">新增报障</a>
                        </div>
                    </form>
                </div>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th><input name="allCheck" type="checkbox" value="" id="allCheck" ng-click="allCheck($event,data)"/>全选</th>
                        <th>设备名称</th>
                        <th>发起用户</th>
                        <th>手机号码</th>
                        <th>故障描述</th>
                        <th>维修组</th>
                        <!-- <th>维修人员姓名</th>
                        <th>维修人员电话</th> -->
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody class="tbody">
                    <tr ng-repeat="item in pageInfo.data">
                        <td class="v-middle"><input name="Fruit" type="checkbox"value="{{item.maintainId}}" ng-click="checkStatus()" ng-if="item.status=='待派单'"/></td>
                        <td class="v-middle">{{item.deviceName}}</td>
                        <td class="v-middle">
                            <span ng-if="item.personName=='null'"></span>
                            <span ng-if="item.personName !='null'">{{item.personName}}</span>
                        </td>
                        <td class="v-middle">{{item.mobileNo}}</td>
                        <td class="v-middle">{{item.description}}</td>
                        <td class="v-middle">{{item.maintainGroupCode}}</td>
                        <!-- <td class="v-middle">{{item.maintainUserName}}</td>
                        <td class="v-middle">{{item.maintainUserMobileNo}}</td> -->
                        <td class="v-middle statusContro">{{item.status}}</td>
                        <td class="v-middle">
                            <a ng-click="openDmBuilding(item.maintainId,item.status)" ng-show="item.status=='待派单'" class="deleBtn">派单</a>
                             <a ui-sref="main.dm.DmMaintain.mainTainDetials({id:item.maintainId})" class="deleBtn">详情</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <!-- /.table-responsive -->

            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.wrapper-data -->

</div>
<!-- /.wrapper-md -->

<!-- 派单模态框 -->
<script type="text/ng-template" id="appUserList.html">
    <!-- 内容区域 -->
    <div ng-hide="loading" class="wrapper-md content">
        <!-- 数据显示 -->
        <div class="wrapper-data" style="margin-top: 0;">
            <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">

                    <div class="w-auto">
                        <form ng-submit="search()" class="form-inline">

                            <div class="form-group"style="width: 30%;">
                                <label for="name">姓名：</label>
                                <input type="text"class="form-control" style="width: 160px"
                                       placeholder="" ng-model="param.personName">
                            </div>
                            <div class="form-group"style="width: 30%;">
                                <label for="name">手机号码：</label>
                                <input type="text"class="form-control" style="width: 160px"
                                       placeholder="" ng-model="param.mobileNo">
                            </div>

                            <button type="submit" class="btn btn-primary new-primary"
                                    style="margin-left: 10px">查询
                            </button>

                        </form>
                    </div>
                </div>

                <!-- 数据表格 -->
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light text-center">
                        <thead>
                        <tr>
                            <th>姓名</th>
                            <th>手机号码</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in pageInfo.data">
                            <td class="v-middle">{{item.personName}}</td>
                            <td class="v-middle">{{item.mobileNo}}</td>
                            <td class="v-middle">
                                <a ng-click="selectAppUser(item.userId)" class="deleBtn">选择</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div><!-- /.table-responsive -->

                <!-- 底部分页 -->
                <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
            </div><!-- /.panel -->
        </div><!-- /.wrapper-data -->

    </div><!-- /.wrapper-md -->
    <div class="modal-footer">
        <button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
    </div>
</script>

<!-- 维修组模态框 -->
<script type="text/ng-template" id="groupList.html">
    <!-- 内容区域 -->
    <div ng-hide="loading" class="wrapper-md content">
        <!-- 数据显示 -->
        <div class="wrapper-data">
            <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">
                </div>

                <!-- 数据表格 -->
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light text-center">
                        <thead>
                        <tr>
                            <th>维修组编码</th>
                            <th>维修组名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in pageInfo.data">
                            <td class="v-middle">{{item.groupCode}}</td>
                            <td class="v-middle">{{item.groupName}}</td>
                            <td class="v-middle">
                                <a ng-click="selectGroup(item.groupCode)" class="deleBtn">选择</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div><!-- /.table-responsive -->

                <!-- 底部分页 -->
                <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
            </div><!-- /.panel -->
        </div><!-- /.wrapper-data -->

    </div><!-- /.wrapper-md -->
    <div class="modal-footer">
        <button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
    </div>
</script>

<style scoped>
    input[type=checkbox]{ width:18px;  height:18px;border: 1px solid #ebebeb;vertical-align: middle;margin-top: 0;}
    .modal-dialog{width:1000px;margin: 0 auto;}
    .statusContro{color: #27c24c;}
    .deleBtn{
        padding:2px 3px;
        border:solid 1px;color:#fb7009;
        border-radius:4px;
        background: none;
    }
    .deleBtn:hover{
        background-color: #fb7009;
        color: #FFF;
        border-radius:0px;
    }
</style>